package com.study.manage.dal;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.study.manage.domain.BlogWhitelist;
import com.study.manage.domain.enumm.BlogWhitelistType;
import com.study.manage.domain.enumm.LiveDieState;

public interface BlogWhitelistRepository extends PagingAndSortingRepository<BlogWhitelist, Long> {

    List<BlogWhitelist> findByBlogIdAndUserIdAndState(Long blogId, Long userId, LiveDieState state);

    int countByBlogIdAndState(Long blogId, LiveDieState state);

    Page<BlogWhitelist> findByBlogIdAndState(Long blogId, LiveDieState state, Pageable pageable);

    List<BlogWhitelist> findByBlogIdAndUserIdAndTypeAndState(Long blogId, Long userId,
            BlogWhitelistType type, LiveDieState state);
}
